package com.study.manage.dal;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.study.manage.domain.EvaluateCommodity;
import com.study.manage.domain.enumm.LiveDieState;

public interface EvaluateCommodityRepository
        extends PagingAndSortingRepository<EvaluateCommodity, Long> {


    int countByEvaluateIdAndState(Long evaluateId, LiveDieState state);

    Page<EvaluateCommodity> findByEvaluateIdAndState(Long evaluateId, LiveDieState state,
            Pageable pageable);


    @Query("select t from EvaluateCommodity t where t.evaluateId=:evaluateId and t.state=0")
    Page<EvaluateCommodity> findGGByEvaluateId(@Param("evaluateId") Long evaluateId,
            Pageable pageable);
}
